package hc.bre.cmn

import java.lang.reflect.ParameterizedType

@groovy.transform.CompileStatic
@groovy.transform.ToString(includeNames=true,includePackage=false)
class TreeReferItem<T extends ReferItem> extends ReferItem{
	List<T> list;

		@Override
	public TreeReferItem load(Map map) {
		super.load(map);
		
		this.list = hc.Util.loadList(map['list'], realClass())

		return this;
	}
	
	private Class<T> realClass()
	{
		ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass();
		return (Class<T>) pt.getActualTypeArguments()[0];;
	}
	
}
